// Tabbed Pane project template
import bb.cascades 1.0
import bb.system 1.0
import "./add"
import "./chart"
import "./help"
import "./history"
import "./home"
import "./setting"

TabbedPane {
    id: root
    
    showTabsOnActionBar: true
    Tab {
        title: lang.bottom_home
        imageSource: "asset:///images/home.png"
        Home{
            id: home
        }
    }
    Tab {
        title: lang.bottom_add
        imageSource: "asset:///images/add.png"
        Add{}
    }
    Tab {
        title: lang.bottom_history
        imageSource: "asset:///images/history.png"
        History{}
    }
    Tab {
        title: lang.bottom_chart
        imageSource: "asset:///images/chart.png"
        Chart{}
    }
    onCreationCompleted: {
        // this slot is called when declarative scene is created
        // write post creation initialization here
        console.log("TabbedPane - onCreationCompleted()")
        
        //        if (backend.getLang() == ""){
        //            var guidepage = firstGuide.createObject();
        //            homeNavigation.push(guidepage);
        //        }
        
        // enable layout to adapt to the device rotation
        // don't forget to enable screen rotation in bar-bescriptor.xml (Application->Orientation->Auto-orient)
        OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.All;
    }
    
    function showmsg(message){
        msg.body = message ;
        msg.show() ;
    }
    
    attachedObjects: [
        Language {
            id: lang
        },
        SystemToast {
            id: msg
            body: ""
            //                             onFinished:{
            //                                 Application.quit();
            //                             } 
        }
    
    
    //        Dialog{
    //            id: langDialog
    //            LangSelect{
    //                
    //                onClose:{
    //                    langDialog.close();
    //                }
    //            }
    //        }
    ]

}
